package com.hc.cosmetichospital.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hc.cosmetichospital.mapper.ConsultingMapper;
import com.hc.cosmetichospital.pojo.Consulting;
import com.hc.cosmetichospital.pojo.ResultMap;
import com.hc.cosmetichospital.service.ConsultingService;
import com.hc.cosmetichospital.vo.ConsultingVo;

@Service
public class ConsultingServiceImpl implements ConsultingService {

	@Autowired
	private ConsultingMapper consultingMapper;
	
	@Override
	public ResultMap<Consulting> getConsultingById(Integer id) {
		List<Consulting> consultingList = consultingMapper.getConsultingListByClientId(id);
		return new ResultMap<Consulting>(consultingList,consultingList.size());
	}

	@Override
	public int addConsulting(ConsultingVo consultingVo) {
		return consultingMapper.insertSelective(consultingVo);
	}

	@Override
	public int deleteClientConsulting(Integer id) {
		return consultingMapper.deleteByPrimaryKey(id);
	}
	
	

}
